const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    // 跨域配置
    proxy: {
      '/api': {    //以 /api 开头的生效
        target: "http://localhost:8081",
        changOrigin: true,   //允许跨域
        pathRewrite: {
          '^/api': '/'
        }
      }
    }
  }
})
